<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="  Z">
    <link rel="Shortcut Icon" href="icon/all.png" />
    <title>MTM后台管理系统 v1.0</title>


    <!-- Bootstrap core CSS -->
    <link href="lib/flatlab/css/bootstrap.min.css" rel="stylesheet">
    <link href="lib/flatlab/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="lib/flatlab/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="lib/flatlab/assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css"
        media="screen" />
    <link rel="stylesheet" href="lib/flatlab/css/owl.carousel.css" type="text/css">
    <!-- Custom styles for this template -->
    <link href="lib/flatlab/css/style.css" rel="stylesheet">
    <link href="lib/flatlab/css/style-responsive.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
    <script src="lib/flatlab/js/html5shiv.js"></script>
    <script src="lib/flatlab/js/respond.min.js"></script>
    <![endif]-->
</head>
<style>
    #main-content {
        margin-left: 20px;
        margin-top: -50px;
    }

    .site-footer .text-center a {
        color: #53bee6;
    }

    .textarea {
        height: 100px;
        resize: none;
        font-size: 14px;
        padding: 4px;

        box-sizing: border-box;
        border: solid 1px #ddd;
        width: 100%;
        -webkit-transition: all .2s linear 0s;
        -moz-transition: all .2s linear 0s;
        -o-transition: all .2s linear 0s;
        transition: all .2s linear 0s;
    }

    .radius {
        border-radius: 4px;
    }
</style>

<body>
    <section id="container">
        <!--main content start-->
        <section id="main-content">
            <section class="wrapper" >
                <!--state overview start-->
                <div class="row state-overview">
                    <div class="col-lg-3 col-sm-6" >
                        <section class="panel" onclick="openFrame('order-uncomfired-list','未确认订单')">
                            <div class="symbol terques">
                                <i class="icon-user"></i>
                            </div>
                            <div class="value">
                                <h1 id="count" class="count">
                                    ...
                                </h1>
                                <p>未确认</p>
                            </div>
                        </section>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <section class="panel" onclick="openFrame('order-dispens-list','待配药订单')">
                            <div class="symbol red">
                                <i class="icon-tags"></i>
                            </div>
                            <div class="value">
                                <h1 id="count2" class="count2">
                                    ...
                                </h1>
                                <p>配药中</p>
                            </div>
                        </section>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <section class="panel" onclick="openFrame('order-review-list','待审核订单列表')">
                            <div class="symbol yellow">
                                <i class="icon-shopping-cart"></i>
                            </div>
                            <div class="value">
                                <h1 id="count3" class=" count3">
                                    ...
                                </h1>
                                <p>审核中</p>
                            </div>
                        </section>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <section class="panel" onclick="openFrame('order-peisong-list','配送中订单列表')">
                            <div class="symbol blue">
                                <i class="icon-bar-chart"></i>
                            </div>
                            <div class="value">
                                <h1 id="count4" class=" count4">
                                    ...
                                </h1>
                                <p>配送中</p>
                            </div>
                        </section>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <section class="panel" onclick="openFrame('order-finish-list','已完成订单列表')">
                            <div class="symbol blue">
                                <i class="icon-bar-chart"></i>
                            </div>
                            <div class="value">
                                <h1 id="count5" class=" count4">
                                    ...
                                </h1>
                                <p>已完成</p>
                            </div>
                        </section>
                    </div>

                    <div class="col-lg-3 col-sm-6">
                        <section class="panel" onclick="openFrame('order-cancel-list','已取消订单')">
                            <div class="symbol blue">
                                <i class="icon-bar-chart"></i>
                            </div>
                            <div class="value">
                                <h1 id="count6" class=" count6">
                                    ...
                                </h1>
                                <p>已取消</p>
                            </div>
                        </section>
                    </div>

                </div>
                <div class="row state-overview">
                    <div class="col-lg-3 col-sm-6">
                        <section class="panel">
                            <header class="panel-heading">
                                智能粘贴新增订单
                            </header>
                            <div class="panel-body">
                                <div class="formControls col-xs-8 col-sm-9"><textarea id="addrText"
                                        class="textarea radius" name="description" cols="" rows="" placeholder="地址粘贴到这"
                                        dragonfly="true"></textarea>
                                    <button type="button" style="margin-top:20px " onclick="addorder()"
                                        class="btn btn-success">新增订单</button>

                                </div>
                            </div>

                        </section>
                    </div>
                </div>

                <!--state overview end-->
            </section>
        </section>
        <!--main content end-->
        <!--footer start-->
        <!--footer end-->
    </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="lib/flatlab/js/jquery.js"></script>
    <script src="lib/flatlab/js/jquery-1.8.3.min.js"></script>
    <script src="lib/flatlab/js/bootstrap.min.js"></script>
    <script src="lib/flatlab/js/jquery.scrollTo.min.js"></script>
    <script src="lib/flatlab/js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="lib/flatlab/js/jquery.sparkline.js" type="text/javascript"></script>
    <script src="lib/flatlab/assets/jquery-easy-pie-chart/jquery.easy-pie-chart.js"></script>
    <script src="lib/flatlab/js/owl.carousel.js"></script>
    <script src="lib/flatlab/js/jquery.customSelect.min.js"></script>
    <script src="lib/flatlab/js/respond.min.js"></script>

    <script class="include" type="text/javascript" src="lib/flatlab/js/jquery.dcjqaccordion.2.7.js"></script>

    <!--common script for all pages-->
    <script src="lib/flatlab/js/common-scripts.js"></script>

    <script type="text/javascript" src="lib/layer/2.4/layer.js"></script>

    <!--script for this page-->
    <script src="lib/flatlab/js/sparkline-chart.js"></script>
    <script src="lib/flatlab/js/easy-pie-chart.js"></script>
    <script src="lib/flatlab/js/count.js"></script>
    <script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--/_footer 作为公共模版分离出去-->
    <script type="text/javascript" src="lib/common.js"></script>
    <script type="text/javascript" src="lib/addressParse/arealist.js"></script>
    <script type="text/javascript" src="lib/addressParse/address-parse.js"></script>

    <span id="busuanzi_container_site_uv">
        <span style="display: none" id="busuanzi_value_site_uv"></span>
    </span>

    <script>
        $("#username").html(parent.username);
        parseArea(areaList);

        var now = new Date(),
            hour = now.getHours();
        if (hour < 6) {
            $("#hello").html("凌晨好！");
        } else if (hour < 9) {
            $("#hello").html("早上好！");
        } else if (hour < 12) {
            $("#hello").html("上午好！");
        } else if (hour < 14) {
            $("#hello").html("中午好！");
        } else if (hour < 17) {
            $("#hello").html("下午好！");
        } else if (hour < 19) {
            $("#hello").html("傍晚好！");
        } else if (hour < 22) {
            $("#hello").html("晚上好！");
        } else {
            $("#hello").html("深夜好！");
        }


        //owl carousel
        $(document).ready(function () {
            $("#owl-demo").owlCarousel({
                navigation: true,
                slideSpeed: 300,
                paginationSpeed: 400,
                singleItem: true,
                autoPlay: true

            });
        });

        //custom select box
        $(function () {
            $('select.styled').customSelect();
        });


        function showDate(time) {
            var date = new Date(time);
            var y = date.getFullYear();
            var m = date.getMonth() + 1;
            m = m < 10 ? ('0' + m) : m;
            var d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            var h = date.getHours();
            h = h < 10 ? ('0' + h) : h;
            var minute = date.getMinutes();
            var second = date.getSeconds();
            minute = minute < 10 ? ('0' + minute) : minute;
            second = second < 10 ? ('0' + second) : second;
            return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
        }

        if ($("#hot-title").text().length > 18) {
            $("#hot-title").text($("#hot-title").text().substring(0, 18) + "...");

        }

        $.ajax({
            url: "./sys/base",
            type: 'GET',
            success: function (data) {
                if (data.success != true) {
                    layer.alert(data.message, {
                        title: '错误信息',
                        icon: 2
                    });
                    return;
                }
                if (data.result.hasAllNotice == 1) {
                    allNotice(data.result.allNotice);
                }
            },
            error: function (XMLHttpRequest) {
                if (XMLHttpRequest.status != 200) {
                    layer.alert('数据处理失败! 错误码:' + XMLHttpRequest.status + ' 错误信息:' + JSON.parse(
                        XMLHttpRequest.responseText).message, {
                        title: '错误信息',
                        icon: 2
                    });
                }
            }
        });

        function allNotice(data) {
            layer.open({
                type: 1,
                title: '通知',
                area: ['350px', '230px'],
                content: '<div style="margin: 10px 20px 10px 20px;">' + data + '</div>',
                btn: ['知道了'],
                shade: 0 //不显示遮罩
                ,
                yes: function () {
                    layer.closeAll();
                }
            });
        }

        var result, index
        function addorder() {
            var addr = $('#addrText').val()
            if (addr && addr !== "") {
                result = parse(addr)
            }
            index = layer_show("新增订单", "order-add");
        }
        function msgSuccess(content) {
            layer.msg(content, { icon: 1, time: 3000 });
        }



        $.ajax({
            url: "./report/order/count",
            type: 'GET',
            success: function (data) {
                if (!data.success) {
                    layer.alert(data.message, {
                        title: '错误信息',
                        icon: 2
                    });
                    return;
                }else {
                    console.log(data)
                    $('#count').html(data.result.uncomfired)
                    $('#count2').html(data.result.quyao)
                    $('#count3').html(data.result.review)
                    $('#count4').html(data.result.ship)
                    $('#count5').html(data.result.finished)
                    $('#count6').html(data.result.cancel)
                }

            },
            error: function (XMLHttpRequest) {
                if (XMLHttpRequest.status != 200) {
                    layer.alert('数据处理失败! 错误码:' + XMLHttpRequest.status + ' 错误信息:' + JSON.parse(
                        XMLHttpRequest.responseText).message, {
                        title: '错误信息',
                        icon: 2
                    });
                }
            }
        });

    </script>
<script>

    function openFrame(url,title){
        creatIframe(url,title)
    }
</script>

</body>

</html>